package com.cloud.api.controller;
import com.cloud.api.model.User;
import com.cloud.fillte.annotation.LogAnnotation;
import com.cloud.api.service.UserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@LogAnnotation//自定义拦截注解
@RequestMapping("hello")
public class Hello {
    @Value("${content}")
    String content;
    @Value("${server.port}")
    String port;

    @Autowired
    UserService userService;


    @ApiOperation(value="获取用户详细信息", notes="根据url的id来获取用户详细信息")
    @ApiImplicitParam(name = "id", value = "用户ID", required = true, dataType = "Integer", paramType = "path")
    @RequestMapping("/port")
    public String home() {

        User user = userService.findById();
       System.out.println(user.getUser2().getName()  + "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
        return "Hello world ,port:" + port+",content="+content;
    }

}
